/**
 * Copyright(c) 2014 Xunton Solutions
 *
 * History:
 *   15-9-11 下午2:45 Created by dwzhang
 */
package com.jade.bss.base.journal;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Lob;
import javax.persistence.MappedSuperclass;

import com.jade.journal.JournalEntity;

/**
 * 操作日志。
 *
 * @author <a href="mailto:dwzhang@xunton.com">dwzhang</a> 
 * @version 1.0 15-9-11 下午2:45
 */
@MappedSuperclass
public class OperationJournal
        extends JournalEntity
{
    //操作者类型
    @Column (name = "operator_type", length = 32, nullable = false)
    private String operatorType;
    //操作者
    @Column (name = "operator", length = 64, nullable = false)
    private String operator;
    //远端IP
    @Column (name = "ip", length = 64)
    private String ip;
    //user agent
    @Column (name = "user_agent", length = 256)
    private String userAgent;
    //访问模块
    @Column (name = "module", length = 32, nullable = false)
    private String module;
    //动作
    @Column (name = "action", length = 64, nullable = false)
    private String action;
    //访问url
    @Column (name = "url", length = 128)
    private String url;
    //操作参数
    @Lob
    @Column (name = "params")
    private String params;
    //操作结果
    @Column (name = "result")
    private boolean result;
    //错误代码
    @Column (name = "error_code", length = 16)
    private String errorCode;
    //错误消息
    @Lob
    @Column (name = "error_message")
    private String errorMessage;
    //操作时间
    @Column (name = "op_date", nullable = false, updatable = false)
    private Date opDate;

    public OperationJournal(String name)
    {
        super(name);
    }

    public String getOperatorType()
    {
        return operatorType;
    }

    public void setOperatorType(String operatorType)
    {
        this.operatorType = operatorType;
    }

    public String getOperator()
    {
        return operator;
    }

    public void setOperator(String operator)
    {
        this.operator = operator;
    }

    public String getIp()
    {
        return ip;
    }

    public void setIp(String ip)
    {
        this.ip = ip;
    }

    public String getUserAgent()
    {
        return userAgent;
    }

    public void setUserAgent(String userAgent)
    {
        this.userAgent = userAgent;
    }

    public String getUrl()
    {
        return url;
    }

    public void setUrl(String url)
    {
        this.url = url;
    }

    public String getModule()
    {
        return module;
    }

    public void setModule(String module)
    {
        this.module = module;
    }

    public String getAction()
    {
        return action;
    }

    public void setAction(String action)
    {
        this.action = action;
    }

    public String getParams()
    {
        return params;
    }

    public void setParams(String params)
    {
        this.params = params;
    }

    public boolean isResult()
    {
        return result;
    }

    public void setResult(boolean result)
    {
        this.result = result;
    }

    public String getErrorCode()
    {
        return errorCode;
    }

    public void setErrorCode(String errorCode)
    {
        this.errorCode = errorCode;
    }

    public String getErrorMessage()
    {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage)
    {
        this.errorMessage = errorMessage;
    }

    public Date getOpDate()
    {
        return opDate;
    }

    public void setOpDate(Date opDate)
    {
        this.opDate = opDate;
    }
}
